<?php
namespace BP\Sys\FrmUI;
require_once("BP/En/Map.php");
require_once("BP/Web/WebUser.php");
class ExtHandWriting extends EntityMyPK {
	public function getTarget () 
	{
		return $this->GetValStringByKey(MapAttrAttr::$Tag1);
	}
	public function setTarget ($value) // [String value]
	{
		$this->SetValByKey(MapAttrAttr::$Tag1, $value);
	}
	public function getURL () 
	{
		return $this->GetValStringByKey(MapAttrAttr::$Tag2)->replace("#", "@");
	}
	public function setURL ($value) // [String value]
	{
		$this->SetValByKey(MapAttrAttr::$Tag2, $value);
	}
	public function getFK_MapData () 
	{
		return $this->GetValStrByKey(MapAttrAttr::$FK_MapData);
	}
	public function setFK_MapData ($value) // [String value]
	{
		$this->SetValByKey(MapAttrAttr::$FK_MapData, $value);
	}
	public function getKeyOfEn () 
	{
		return $this->GetValStringByKey(MapAttrAttr::$KeyOfEn);
	}
	public function setKeyOfEn ($value) // [String value]
	{
		$this->SetValByKey(MapAttrAttr::$KeyOfEn, $value);
	}
	public function getName () 
	{
		return $this->GetValStrByKey(MapAttrAttr::$Name);
	}
	public function setName ($value) // [String value]
	{
		$this->SetValByKey(MapAttrAttr::$Name, $value);
	}
	public function getHisUAC () 
	{
		$uac = new UAC();
		$uac->Readonly();
		if ($WebUser->getNo()->equals("admin"))
		{
			$uac->IsUpdate =  TRUE ;
			$uac->IsDelete =  TRUE ;
		}
		return $uac;
	}
	public static function constructor__ () 
	{
		$me = new self();
		return $me;
	}
	public static function constructor__String ($mypk) // [String mypk]
	{
		$me = new self();
		$me->setMyPK($mypk);
		$me->Retrieve();
		return $me;
	}
	public function getEnMap () 
	{
		if (($this->get_enMap() != NULL))
		{
			return $this->get_enMap();
		}
		$map = new Map("Sys_MapAttr", "手写签名�?");
		$map->Java_SetDepositaryOfEntity($Depositary->None);
		$map->Java_SetDepositaryOfMap($Depositary->Application);
		$map->Java_SetEnType($EnType->Sys);
		$map->AddMyPK();
		$map->AddTBString(MapAttrAttr::$FK_MapData, NULL, "表单ID",  TRUE ,  TRUE , 1, 100, 20);
		$map->AddTBString(MapAttrAttr::$KeyOfEn, NULL, "字段",  TRUE ,  TRUE , 1, 100, 20);
		$map->AddDDLSQL(MapAttrAttr::$GroupID, 0, "显示的分�?", MapAttrString::getSQLOfGroupAttr(),  TRUE );
		$map->AddDDLSysEnum(MapAttrAttr::$TextColSpan, 1, "文本单元格数�?",  TRUE ,  TRUE , "ColSpanAttrString", "@1=�?1个单元格@2=�?2个单元格@3=�?3个单元格@4=�?4个单元格");
		$map->AddTBInt(MapAttrAttr::$RowSpan, 1, "行数",  TRUE ,  FALSE );
		$map->AddTBInt(MapAttrAttr::$UIHeight, 1, "高度",  TRUE ,  FALSE );
		$map->AddTBInt(MapAttrAttr::$UIWidth, 1, "宽度",  TRUE ,  FALSE );
		$map->AddTBString(MapAttrAttr::$Name, NULL, "名称",  TRUE ,  FALSE , 0, 500, 20,  TRUE );
		$this->set_enMap($map);
		return $this->get_enMap();
	}
	protected function afterDelete () 
	{
		if (($this->getFK_MapData()->contains("ND") ==  TRUE ))
		{
			$fk_mapData = ($this->getFK_MapData()->substring(0, ($this->getFK_MapData()->length() - 2)) . "Rpt");
			$sql = (((("DELETE FROM Sys_MapAttr WHERE FK_MapData='" . $fk_mapData) . "' AND KeyOfEn='") . $this->getKeyOfEn()) . "'");
			DBAccess::RunSQL($sql);
		}
		CCFormAPI->AfterFrmEditAction($this->getFK_MapData());
		parent->afterDelete();
	}
}
?>
